home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java for 3D & VRML Worlds
/
Java for 3d and VRML Worlds.iso
/
world
/
blur2
/
blur2.java
< prev
next >
Wrap
Text File
|
1996-10-17
|
2KB
|
105 lines
// "Blur Effect" with one blur object
// created by ask@krc.sony.co.jp (Masamichi zzzcat Asukai)
//
// Copyright(C) 1996 Sony Corporation. All rights reserved.
//
import vrml.*;
import vrml.node.*;
import vrml.field.*;
public class blur2 extends Script {
private SFVec3f setTranslation;
private SFVec3f setScale;
private SFRotation setRotation;
private float[] translation = new float[3];
private float[] scale = new float[3];
private float[] rotation = new float[4];
private Node realobj;
// constructor
public void initialize() {
setTranslation = (SFVec3f)getEventOut("setTranslation");
setScale = (SFVec3f)getEventOut("setScale");
setRotation = (SFRotation)getEventOut("setRotation");
realobj = (Node)((SFNode)getField("realobj")).getValue();
// get information of real object
((SFVec3f)realobj.getExposedField("translation")).getValue(translation);
((SFVec3f)realobj.getExposedField("scale")).getValue(scale);
((SFRotation)realobj.getExposedField("rotation")).getValue(rotation);
}
public void processEvent(Event e) {
if (e.getName().equals("interval")) {
// set information of blur object
setTranslation.setValue(translation);
setScale.setValue(scale);
setRotation.setValue(rotation);
// get information of real object
((SFVec3f)realobj.getExposedField("translation")).getValue(translation);
((SFVec3f)realobj.getExposedField("scale")).getValue(scale);
((SFRotation)realobj.getExposedField("rotation")).getValue(rotation);
}
}
}